package main

import (
	"fmt"
	"gitee.com/magein/go-utils/mb"
	oss "gitee.com/magein/go-utils/os"
	tools "gitee.com/magein/go-utils/tool"
)

func main() {

	setting := oss.SearchFileSetting{
		Path: "D:\\develop\\docker",
	}
	var res []oss.FileInfo
	oss.SearchFile(setting, &res)

	for _, file := range res {
		fmt.Println(file.Path, file.Name, file.SizeFormat)
	}

	fmt.Println("is int", tools.IsInt(1))
	fmt.Println("index of", tools.IndexOf([]int{1, 2}, 2))
	fmt.Println("in array ", tools.InArray("1,2,3,png", "png"))
	fmt.Println("file extension", oss.FileExtension("a.jp.png"))
	fmt.Println("file extension tolower", oss.FileExtension("a.jp.PNG"))
	fmt.Println("汉字长度", len("1a小马哥"))
	fmt.Println("汉字长度", mb.Len("1a小马哥"))
	fmt.Println("汉字截取", mb.Sub("1a小马哥", 2, 2))
}

func xunhuan(end *[]int) {

	*end = append(*end, 1, 2, 3, 4)

	fmt.Println("end", end)
}
